<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>第二周/02/2流程控制语句.html</title>
  </head>
  <body></body>
  <script>
    /*
    if else if else
    switch(a){
        case 1:
            1+2;
            break;
        case 2:
            ...
    }
    do{

    }while(a);
    while(true){
      break;
    }
    while一般配合true和break使用



    for(){

    }
    */
    var a = ["Saab", "Volvo", "BMW"];
    console.log(a);
    // console.log("qiani=" + i);

    function function1(b) {
      for (i = 0; i < b.length; i++) {
        b[i] = "张三";
      }
      console.log("i=" + i);
      return b;
    }

    function function12(n) {
      if (n == 0) {
        function12(n * 0);
        console.log(n);
      } else {
        return 0;
      }
    }

    console.log(function1(a));
    console.log(a);
    console.log("houi=" + i);
    // console.log(function12(0));
    for (i = 1; i <= 100; i++) {
      if (i % 2 == 0) {
        console.log(i);
      } else if (i % 7 == 0) {
        break;
      }
    }
  </script>
</html>
